package io.coding.utils;


import jodd.http.HttpRequest;
import jodd.http.HttpResponse;
import org.slf4j.LoggerFactory;

import java.io.IOException;
import java.util.Random;

/**
 * Created by Administrator on 2014/9/25.
 */
public class DateUtils {
    private static final org.slf4j.Logger logger = LoggerFactory.getLogger(DateUtils.class);

    public static Long Online(){
        String url = null;
        try {
            url = JoddProrUtils.getValue(JoddProrUtils.OTHER_PROPS, "system.date.hk.url");
        } catch (IOException e) {
            e.printStackTrace();
        }
        Random random = new Random();
        url = String.format(url,random.nextInt()*89999999);
        HttpResponse response = HttpRequest.get(url).send();
        Long re = Long.parseLong(response.bodyText().replace("0=",""));
        return re;
    }
}
